package com.prizedraw.prize_draw.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.prizedraw.prize_draw.entity.SysRole;
import com.prizedraw.prize_draw.mapper.SysRoleMapper;
import com.prizedraw.prize_draw.service.SysRoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author czj666
 * @since 2021-09-07
 */
@Service
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements SysRoleService {

    @Override
    public List<SysRole> listRolesByDepartmentId(Integer departmentId) {
        return this.list(new QueryWrapper<SysRole>().inSql("id","select role_id from department_role where department_id = " + departmentId));
    }
}
